{include file="common/header"}
<div class="content-wrapper">
    {include file="auth_rule/nav"/}
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="nav-tabs-custom">
                    {include file="auth_rule/tabs"/}
                    <div class="tab-content">
                        <div class="page-content">
                            <div class="panel panel-info">
                                <div class="panel-heading">筛选</div>
                                <div class="panel-body">
                                    <form class="form-horizontal" role="form">
                                        <div class="form-group">
                                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">关键词</label>
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                                                <input type="text" class="form-control" name="keyword" value="{$_REQUEST['keyword']?$_REQUEST['keyword']:''}" placeholder="请输入搜索关键词">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12 col-md-offset-2 col-lg-offset-2 col-sm-offset-4">
                                                <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <form method="post" class="form-horizontal" id="display_form">
                                <div class="panel panel-default ">
                                    <div class="table-responsive panel-body">
                                        <table class="table table-bordered table-hover">
                                            <tr>
                                                <th>节点名称</th>
                                                <th>节点地址</th>
                                                <th>节点类型</th>
                                                <th>状态</th>
                                                <th>是否菜单</th>
                                                <th>节点图标</th>
                                                <th>排序</th>
                                                <th width="124">操作</th>
                                            </tr>
                                            {volist name="list" id="vo"}
                                            <tr>
                                                <td>
                                                    {eq name="vo['level']" value="3"}　　　│　　　├{/eq}
                                                    {eq name="vo['level']" value="2"}　　　├{/eq}
                                                    <span class="editable" data-pk="{$vo.id}" data-name="title" data-url="{:U('edit', 'id=' . $vo['id'])}" >{$vo.title}</span>
                                                </td>
                                                <td><span class="editable" data-pk="{$vo.id}" data-name="name" data-url="{:U('edit', 'id=' . $vo['id'])}" >{$vo.name}</span></td>
                                                <td>
                                                    {if $vo['level'] == 1}
                                                    项目
                                                    {elseif $vo['level'] == 2}
                                                    模块
                                                    {else}
                                                    操作
                                                    {/if}
                                                </td>
                                                <td>
                                                    <a href="javascript:void(0);" data-id="{$vo.id}" data-field="status" 
                                                    data-value="{$vo.status}" data-url="{:url('edit', 'id='.$vo['id'])}" 
                                                    class='editimg fa {if condition=" $vo.status == 1 "}fa-check-circle text-green{else /}fa-times-circle text-red{/if}'></a>
                                                </td>
                                                <td>
                                                    <a href="javascript:void(0);" data-id="{$vo.id}" data-field="ismenu" 
                                                    data-value="{$vo.ismenu}" data-url="{:url('edit', 'id='.$vo['id'])}" 
                                                    class='editimg fa {if condition=" $vo.ismenu == 1 "}fa-check-circle text-green{else /}fa-times-circle text-red{/if}'></a>
                                                </td>
                                                <td><i class="{$vo.icon}"></td>
                                                <td>{$vo.sorts}</td>
                                                <td>
                                                    <a href="{:U('post', 'id=' . $vo['id'])}" class="btn btn-sm btn-success">编辑</a>
                                                </td>
                                            </tr>
                                            {/volist}
                                        </table>
                                    </div>
                                </div>
                            </form>
                            <script type="text/javascript">
                                $(function () {
                                    $('button[name="submit"]').bind('click',function() {
                                        if (confirm('删除后不可恢复，您确定删除吗？')) {
                                            $.post(
                                                window.location.href,
                                                $('#display_form').serialize(),
                                                function (ret) {
                                                    message(ret.message, ret.redirect, ret.type);
                                                }, 'json'
                                            );
                                        }
                                    });
                                });
                            </script>
                        </div>
                    </div>
                    <!-- /.tab-content -->
                </div>
                <!-- /.nav-tabs-custom -->
            </div>
            <!-- /.col -->
        </div>
    </section>
</div>
{include file='common/ufooter'}
